#! /bin/bash

# Filename: env.sh 2016-09-30
# Author: Huoty <sudohuoty@gmail.com>
# Script starts from here:

umask 002

export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export LC_CTYPE=C.UTF-8

if type activate >/dev/null 2>&1; then
    source activate kibot > /dev/null 2>&1
elif type workon >/dev/null 2>&1; then
    source workon kibot > /dev/null 2>&1
else
    echo "Error: Unable to switch working environment!"
fi

PRODIR="$( cd "$( dirname "$0"  )" && pwd  )"
cd $PRODIR
source kibotrc

export PYTHONPATH="$PRODIR:$PYTHONPATH"
export PYTHONIOENCODING=UTF-8

if [ '$*' != '' ] ; then
    exec $*
fi
